import time
import Board

print('''
**********************************************************
********功能:幻尔科技树莓派扩展板，蜂鸣器控制例程*********
**********************************************************
----------------------------------------------------------
Official website:http://www.lobot-robot.com/pc/index/index
Online mall:https://lobot-zone.taobao.com/
----------------------------------------------------------
以下指令均需在LX终端使用，LX终端可通过ctrl+alt+t打开，或点
击上栏的黑色LX终端图标。
----------------------------------------------------------
Usage:
    sudo python3 BuzzerControlDemo.py
----------------------------------------------------------
Version: --V1.0  2020/08/12
----------------------------------------------------------
Tips:
 * 按下Ctrl+C可关闭此次程序运行，若失败请多次尝试！
----------------------------------------------------------
''')

Board.setBuzzer(0) # 关闭

Board.setBuzzer(1) # 打开
time.sleep(0.1) # 延时
Board.setBuzzer(0) #关闭

time.sleep(1) # 延时

Board.setBuzzer(1)
time.sleep(0.5)
Board.setBuzzer(0)